package com.springcloud.feigndemoserver1000.controller;

import com.springcloud.feigndemoserver1000.service.FeignTestService;
import com.springcloud.feigndemoserver1000.service.impl.RemoteTestServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class RemoteTestController {
    @Autowired
    private FeignTestService feignTestService;
    @Autowired
    private RemoteTestServiceImpl remoteTestService;

    /*
     * @Author ZhangBin
     * @Date 2020/8/14 17:19
     * @Description: 远程调用测试
     *
     **/
    @RequestMapping("test001")
    public String test001(){
        String str = feignTestService.test001();
        return str;
    }
    /*
     * @Author ZhangBin
     * @Date 2020/8/14 17:19
     * @Description: @retryable注解，失败重试测试
     *
     **/
    @RequestMapping("retryTest")
    public String retryTest(){
        log.info("RemoteTestController.retryTest-START");
        String result = remoteTestService.retryTest("测试参数",110120);
        log.info("RemoteTestController.retryTest-END.result={}",result);
        return result;
    }
}
